<?php

$facebook_ids = get_input('facebook_ids');
$facebooks = FALSE;

if($facebook_ids) {
	$facebook_ids = json_decode(get_input('facebook_ids'));
	$facebooks = dt_get_users_by_fb_ids($facebook_ids);
}

if (!$facebooks) {
	$facebook_ids = array();
    $facebooks = array();
}

$random = dt_get_random_users_by_fb_ids($facebook_ids);

if ($random) {
    $random->facebook_id = "?????????";
    //$random->fullname = "??? RANDOM ???";
    $facebooks[] = $random;
}

echo json_encode(export_result(200, $facebooks));

?>
